-- weak_enemy
-- created by panyl
-- 削弱敌方属性

return {
    apply = function(prop, baseValue)
        -- 削弱千分比
        local v = prop[3];

        if v == 0 or baseValue <= 0 then
            return baseValue;
        end

        -- 最小削弱一点
        local point = FormulaM.invoke("CALC_BIG_DIVISION", baseValue, v, 1000);
        point = math.max(1, point);

        -- 最多削弱到1点
        return math.max(1, baseValue - point);
    end,

    record = function(target, prop, path)
        return false;
    end
};
